package com.chenfan.mcn.model.dto;

import com.chenfan.common.extension.validation.groups.Add;
import com.chenfan.common.extension.validation.groups.Modify;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 特殊红人归档编码配置保存DTO
 *
 * @author wulg
 * @date 2021-12-19
 **/
@Data
public class StarArchivingCodeRuleSaveDTO implements Serializable {

    private static final long serialVersionUID = -5209356209046255180L;

    /**
     * 主键ID
     */
    @NotNull(message ="主键ID不能为空" , groups ={Modify.class})
    private Long id;

    /**
     * 内部红人
     */
    @NotNull(message ="内部红人不能为空" , groups ={Modify.class})
    private Long starId;

    /**
     * 编码前缀
     */
    @NotBlank(message ="编码前缀不能为空" , groups ={Add.class, Modify.class})
    @Length(min = 1,max = 10, message = "编码前缀长度需要在{min}和{max}之间")
    private String codePrefix;

}
